home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / mipsABI / examples / sup / netcryptvoid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.3 KB  |  93 lines

  1. /*
  2.  * Copyright (c) 1992 Carnegie Mellon University
  3.  * All Rights Reserved.
  4.  * 
  5.  * Permission to use, copy, modify and distribute this software and its
  6.  * documentation is hereby granted, provided that both the copyright
  7.  * notice and this permission notice appear in all copies of the
  8.  * software, derivative works or modified versions, and any portions
  9.  * thereof, and that both notices appear in supporting documentation.
  10.  *
  11.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  12.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  13.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  14.  *
  15.  * Carnegie Mellon requests users of this software to return to
  16.  *
  17.  *  Software Distribution Coordinator  or  Software_Distribution@CS.CMU.EDU
  18.  *  School of Computer Science
  19.  *  Carnegie Mellon University
  20.  *  Pittsburgh PA 15213-3890
  21.  *
  22.  * any improvements or extensions that they make and grant Carnegie Mellon
  23.  * the rights to redistribute these changes.
  24.  */
  25. /**********************************************************************
  26.  * HISTORY
  27.  * $Log: netcryptvoid.c,v $
  28.  * Revision 1.1.1.1  1993/05/21  14:52:17  cgd
  29.  * initial import of CMU's SUP to NetBSD
  30.  *
  31.  * Revision 2.2  92/09/09  22:04:34  mrt
  32.  *     Created.
  33.  *     [92/09/09            mrt]
  34.  * 
  35.  */
  36. /*
  37.  * DATA ENCRYPTION
  38.  *    netcrypt (key)        turn on/off encryption of strings and files
  39.  *      char *key;            encryption key
  40.  *
  41.  */
  42.  
  43. /*
  44.  * Replacement for subroutine version of "crypt" program
  45.  *  for foreign and non-BSD-licensed sites. With this code
  46.  *  you can only run unencrypted sups
  47.  */
  48.  
  49. #include <libc.h>
  50. #include "sup.h"
  51. #include "supmsg.h"
  52.  
  53. /*********************************************
  54.  ***    G L O B A L   V A R I A B L E S    ***
  55.  *********************************************/
  56.  
  57. int cryptflag = 0;        /* whether to encrypt/decrypt data */
  58. char *cryptbuf;            /* buffer for data encryption/decryption */
  59.  
  60. int netcrypt (pword)
  61. char *pword;
  62. {
  63.     if (pword == NULL || (strcmp(pword,PSWDCRYPT) == 0)) {
  64.         cryptflag = 0;
  65.         (void) getcryptbuf (0);
  66.         return (SCMOK);
  67.     }
  68.     return (SCMERR);
  69. }
  70. int getcryptbuf (x)
  71. int x;
  72. {
  73.     static int cryptsize = 0;    /* size of current cryptbuf */
  74.  
  75.     if (cryptflag == 0) {
  76.         return(SCMOK);
  77.     } else 
  78.         return (SCMERR);
  79. }
  80.  
  81. void decode (in,out,count)
  82. char *in,*out;
  83. int count;
  84. {
  85. }
  86.  
  87.  
  88. void encode (in,out,count)
  89. char *in,*out;
  90. int count;
  91. {
  92. }
  93.